package com.woniu.service.goldcommand;

import com.woniu.outlet.mysql.po.GoldMysql;
import com.woniu.util.ApplicationContextHolder;
import lombok.Data;

import java.util.List;

/**
 * @description:
 * @author: my
 * @time: 2021/4/29 16:31
 */
@Data
public class GoldGraphCommand {
    private GoldGraphCommandHandler handler;
    private String type;
    private Integer month;
    public GoldGraphCommand(){
        this.handler =
                ApplicationContextHolder.getApplicationContext().getBean(GoldGraphCommandHandler.class);
    }

    public GoldGraphCommand(String type,Integer month){
        this();
        this.type = type;
        this.month = month;
    }

    public List<GoldMysql> execute(){
        return this.handler.action(this);
    }
}
